.class public Lcom/bitauto/autoeasy/widget/PageControlView;
.super Landroid/widget/LinearLayout;
.source "PageControlView.java"

# interfaces
.implements Lcom/bitauto/autoeasy/widget/MyViewGroup$ScrollToScreenCallback;


# instance fields
.field private context:Landroid/content/Context;

.field private count:I


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 0
    .parameter "context"

    .prologue
    .line 34
    invoke-direct {p0, p1}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    .line 35
    invoke-direct {p0, p1}, Lcom/bitauto/autoeasy/widget/PageControlView;->init(Landroid/content/Context;)V

    .line 36
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 0
    .parameter "context"
    .parameter "attrs"

    .prologue
    .line 29
    invoke-direct {p0, p1, p2}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 30
    invoke-direct {p0, p1}, Lcom/bitauto/autoeasy/widget/PageControlView;->init(Landroid/content/Context;)V

    .line 31
    return-void
.end method

.method private init(Landroid/content/Context;)V
    .locals 0
    .parameter "context"

    .prologue
    .line 39
    iput-object p1, p0, Lcom/bitauto/autoeasy/widget/PageControlView;->context:Landroid/content/Context;

    .line 40
    return-void
.end method


# virtual methods
.method public callback(I)V
    .locals 0
    .parameter "currentIndex"

    .prologue
    .line 43
    invoke-virtual {p0, p1}, Lcom/bitauto/autoeasy/widget/PageControlView;->generatePageControl(I)V

    .line 44
    return-void
.end method

.method public generatePageControl(I)V
    .locals 3
    .parameter "currentIndex"

    .prologue
    .line 47
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/widget/PageControlView;->removeAllViews()V

    .line 48
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    iget v2, p0, Lcom/bitauto/autoeasy/widget/PageControlView;->count:I

    if-lt v0, v2, :cond_0

    .line 58
    return-void

    .line 50
    :cond_0
    new-instance v1, Landroid/widget/ImageView;

    iget-object v2, p0, Lcom/bitauto/autoeasy/widget/PageControlView;->context:Landroid/content/Context;

    invoke-direct {v1, v2}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    .line 51
    .local v1, imageView:Landroid/widget/ImageView;
    if-ne p1, v0, :cond_1

    .line 52
    const v2, 0x7f02002d

    invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 56
    :goto_1
    invoke-virtual {p0, v1}, Lcom/bitauto/autoeasy/widget/PageControlView;->addView(Landroid/view/View;)V

    .line 48
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 54
    :cond_1
    const v2, 0x7f02002c

    invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setImageResource(I)V

    goto :goto_1
.end method

.method public setCount(I)V
    .locals 0
    .parameter "count"

    .prologue
    .line 25
    iput p1, p0, Lcom/bitauto/autoeasy/widget/PageControlView;->count:I

    .line 26
    return-void
.end method
